package hy;

import hy.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
        ApplicationContext ac = new ClassPathXmlApplicationContext("u.xml");
//        UserService service = (UserService) ac.getBean("service");
        UserService service = ac.getBean(UserService.class);
        try{
            service.login("tom", "123");
        }catch(Exception e){}
        service.logout();
    }
}
